package com.xindong.paking.exception;

import com.xindong.paking.utils.Result;
import com.xindong.paking.utils.ResultStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

    // 处理CustomerException异常
    @ExceptionHandler(CustomerException.class)
    public Result handleCustomerException(CustomerException e) {
        //return new Result(0, e.getMessage());
        return Result.error(e.getMessage());
    }

}
